<template>
  <el-dialog :title="info.title" :visible.sync="visible" append-to-body center width="860px" :before-close="handleCancel">
    <el-form ref="formDate" label-suffix=":" label-width="140px" :rules="rules" :model="form">
      <el-row>
        <el-col :span="12">
          <el-form-item label="姓名" prop="name" style="width: 100%">
            <el-input v-model="form.name" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="员工手机" prop="phone" style="width: 100%">
            <el-input v-model="form.phone" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="实发工资金额" prop="real" style="width: 100%">
            <el-input v-model="form.real" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="基本工资" prop="basic" style="width: 100%">
            <el-input v-model="form.basic" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="职务加给" prop="job" style="width: 100%">
            <el-input v-model="form.job" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="基本绩效" prop="achievement" style="width: 100%">
            <el-input v-model="form.achievement" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="住房补贴" prop="housing" style="width: 100%">
            <el-input v-model="form.housing" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="交通补贴" prop="traffic" style="width: 100%">
            <el-input v-model="form.traffic" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="全勤奖" prop="full" style="width: 100%">
            <el-input v-model="form.full" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="小计" prop="subtotal" style="width: 100%">
            <el-input v-model="form.subtotal" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="社保（公司）" prop="social" style="width: 100%">
            <el-input v-model="form.social" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="公积金（公司）" prop="accumulation_fund" style="width: 100%">
            <el-input v-model="form.accumulation_fund" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="加班补助" prop="overtime" style="width: 100%">
            <el-input v-model="form.overtime" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="饭贴" prop="meal" style="width: 100%">
            <el-input v-model="form.meal" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="津贴" prop="allowance" style="width: 100%">
            <el-input v-model="form.allowance" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="高温补贴" prop="high_temperature_subsidy" style="width: 100%">
            <el-input v-model="form.high_temperature_subsidy" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="总计" prop="total" style="width: 100%">
            <el-input v-model="form.total" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="请假天数" prop="leave_days" style="width: 100%">
            <el-input v-model="form.leave_days" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="请假扣除" prop="de_leave" style="width: 100%">
            <el-input v-model="form.de_leave" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="迟到/未打卡扣除" prop="de_work" style="width: 100%">
            <el-input v-model="form.de_work" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="全勤奖扣除" prop="de_full" style="width: 100%">
            <el-input v-model="form.de_full" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="宿舍房租" prop="de_dorm" style="width: 100%">
            <el-input v-model="form.de_dorm" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="绩效扣除" prop="de_achievements" style="width: 100%">
            <el-input v-model="form.de_achievements" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="代发工资" prop="issue" style="width: 100%">
            <el-input v-model="form.issue" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="个税扣除" prop="de_tax" style="width: 100%">
            <el-input v-model="form.de_tax" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="社保扣款" prop="de_social" style="width: 100%">
            <el-input v-model="form.de_social" size="small" clearable />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="公积金扣除" prop="de_accumulation_fund" style="width: 100%">
            <el-input v-model="form.de_accumulation_fund" size="small" clearable />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="fr mt10">
            <el-button size="small" @click="handleCancel()">取 消</el-button>
            <el-button type="primary" size="small" @click="handleEdit()">保 存</el-button>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>

<script>
import page from '@/utils/page'
import { updSalary } from '@/api/finance/salary'

export default {
  extends: page,
  props: {
    reqUpd: {
      default: updSalary,
      type: Function
    }
  },
  data() {
    return {
      rules: {
        name: [{ required: true, trigger: 'blur', message: '姓名不可为空' }],
        phone: [{ required: true, trigger: 'blur', message: '员工手机不可为空' }],
        real: [{ required: true, trigger: 'blur', message: '实发工资金额不可为空' }]
      }
    }
  },
  watch: {
    visible(val) {
      if (val) {
        this.form = this.info.edit
      }
    }
  },
  mounted() {
  },
  methods: {
  }
}
</script>

<style>

</style>
